
const validateInput = require('./validateInput');

function verify(req, arr, res) {
	let message = "参数验证失败,请检查";
	let error = 0;
	for (i in arr) {
		if (!req.query[arr[i]]) {
			message += "[" + arr[i] + "] ";
			error++;
		} else {
			if (!validateInput(req.query[arr[i]])) {
				message += "[" + arr[i] + "] ";
				error++;
			}
		}
	}
	if (error) {
		console.log(message);
		res.sdErr(message)
	} else {
		return 0;
	}
}
module.exports = verify